home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-13 | 1.3 KB | 62 lines | [TEXT/EDIT] |
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- class TEST_BOOLEAN2
-
- creation make
-
- feature
-
- make is
- do
- is_true(true or else true_call);
- is_true(call_count = 0);
- is_true(not false or else true_call);
- is_true(call_count = 0);
- is_true(not(false and then true_call));
- is_true(call_count = 0);
- is_true(not(not true and then true_call));
- is_true(call_count = 0);
-
- is_true(true or true_call);
- debug
- -- Because mode -boost :-)
- is_true(call_count = 1);
- is_true(not false or true_call);
- is_true(call_count = 2);
- is_true(not(false and true_call));
- is_true(call_count = 3);
- is_true(not(not true and true_call));
- is_true(call_count = 4);
- end;
- end;
-
- true_call: BOOLEAN is
- do
- call_count := call_count + 1;
- Result := true;
- end;
-
- false_call: BOOLEAN is
- do
- call_count := call_count + 1;
- end;
-
- call_count: INTEGER;
-
- is_true(b: BOOLEAN) is
- do
- cpt := cpt + 1;
- if not b then
- std_output.put_string("TEST_BOOLEAN2: ERROR Test # ");
- std_output.put_integer(cpt);
- std_output.put_string("%N");
- else
- --std_output.put_string("Yes%N");
- end;
- end;
-
- cpt: INTEGER;
-
- end -- TEST_BOOLEAN2
-